import { Navigate } from "react-router-dom";

function AuthRoute({ children }: { children: React.ReactNode }) {
  localStorage.setItem("token", "123");
  const token = localStorage.getItem("token");
  if (token) {
    return <>{children}</>;
  } else {
    return <Navigate to="/login" replace />;
  }
}

export default AuthRoute;
